/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.fullhappy.filter;

import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author caohonghiep
 */
public class SessionFilter implements Filter {
    
	 public void doFilter(ServletRequest req, ServletResponse res,
	            FilterChain chain) throws IOException, ServletException {
	        HttpServletRequest request = (HttpServletRequest) req;
	        String sessionId = request.getSession().getId();
	        chain.doFilter(req, res);
	    }
	    public void init(FilterConfig config) throws ServletException {
	         
	        //Get init parameter
	        //String testParam = config.getInitParameter("test-param");
	        
	    }
	    public void destroy() {
	        //add code to release any resource
	    }
}
